<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
	</head>
	<body>
		<div id="p1"></div>
		<!--<input name="1" type="button" value="显示消息" onclick="timer()" />-->
		<script type="text/javascript">
			function ti(){
				var today=new Date();
				var hh=today.getHours();
				var mm=today.getMinutes();
				var ss=today.getSeconds();
				var yyyy=today.getFullYear();
				var DD=today.getDate();
				var MM=today.getMonth();
				var dd=today.getDay();
				
				document.getElementById("p1").innerHTML="现在的时间是"+yyyy+"-"+MM+"-"+DD+" "+hh+":"+mm+":"+ss+"星期"+dd;
			}
			setInterval("ti()",1000)
//			ti();
//			function timer(){
//				var t=setInterval("alert('3 seconds')",3000);
//			}
		</script>
	</body>
</html>
